using System.Collections.Generic;
using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	internal abstract class OracleLpSubquery : OracleLpStatementDataContainer
	{
		protected List<OracleLpColumnDescriptor> m_vColumnDescriptors;

		internal override OracleLpStatementElementType ElementType => OracleLpStatementElementType.Subquery;

		public abstract OracleLpSubqueryType SubqueryType
		{
			get;
		}

		public override List<OracleLpColumnDescriptor> ColumnDescriptors
		{
			get
			{
				if (m_vColumnDescriptors == null)
				{
					Resolve();
				}
				return m_vColumnDescriptors;
			}
		}

		public OracleLpSubquery(OracleLpStatementElement parent)
			: base(parent)
		{
		}

		internal override void ToString(StringBuilder sb)
		{
			string depthIndent = base.DepthIndent;
			sb.Append(depthIndent);
			sb.Append("Subquery Type:");
			sb.Append(SubqueryType.ToString());
			sb.Append('\n');
		}
	}
}
